<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$pos.name} 推荐位内容列表</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a title="新增" class="btn btn-primary" href="{:U('add')}"><i class="glyphicon glyphicon-plus"></i></a>
            <button class="btn ajax-post confirm btn-danger" url="{:U('del')}" target-form="ids">删 除</button>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
    <table class="table table-bordered">
    <thead>
        <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th>类型</th>
        <th>ID</th>
        <th>名称</th>
        <th>排序</th>
        <th>录入时间</th>
        <th>更新时间</th>
        <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <notempty name="_list">
        <volist name="_list" id="vo">
        <tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
            <td>{$type_str}</td>
            <td>{$vo.target_id} </td>
            <td>{$vo.name}</td>
            <td>
                <input class="text form-control" name="sort[{$vo.id}]" value="{$vo.sort}" />
            </td>
            <td><span>{$vo.create_time|time_format}</span></td>
            <td><span>{$vo.update_time|time_format}</span></td>
            <td>
                <a class="btn btn-default btn-xs" title="内容" href="{:U('PosData/index?posId='.$vo['id'])}"><i class="glyphicon glyphicon-picture"></i></a>
                <a href="{:U('del?id='.$vo['id'])}" class="confirm ajax-get btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
            </td>
        </tr>
        </volist>
        <else/>
        <td colspan="8" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
    </tbody>
    </table>
    </div>
    <br><br>
    <div class="form-item form-group form-action">
        <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" onclick="do_submit();" type="submit" target-form="form">确 定 排 序</button>
        <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //确认提交前把selected框所有选中
        function do_submit(){
            $('#selected_video').find('option').prop('selected',true);
        }
        //导航高亮
        highlight_subnav('{:U('index')}');
    </script>
</block>
